package com.dedaletechnology.mrquizz.web;

import java.util.Collection;

import com.dedaletechnology.mrquizz.client.MultipleChoiceQuestionsService;
import com.dedaletechnology.mrquizz.model.MultipleChoiceQuestion;
import com.dedaletechnology.mrquizz.model.MultipleChoiceQuestions;
import com.dedaletechnology.mrquizz.server.MultipleChoiceQuestionRepository;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

/**
 * The server side implementation of the RPC service.
 */
@SuppressWarnings("serial")
public class MultipleQuestionsServiceImpl extends RemoteServiceServlet implements
        MultipleChoiceQuestionsService {

    private MultipleChoiceQuestions multipleChoiceQuestionRepository = new MultipleChoiceQuestionRepository();

    @Override
    public void create(MultipleChoiceQuestion question) {
        multipleChoiceQuestionRepository.create(question);
    }

    @Override
    public void deleteByIdQuestion(Long idQuestion) {
        multipleChoiceQuestionRepository.deleteByIdQuestion(idQuestion);
    }

    @Override
    public Collection<MultipleChoiceQuestion> getAll() {
        return multipleChoiceQuestionRepository.getAll();
    }
}
